#coding=utf-8

from uliweb.orm import *
from uliweb.utils.common import get_var
import datetime

def get_modified_user():
    from uliweb import request
    
    return request.user.id

class Kfzx(Model):
    name = Field(CHAR, verbose_name='名称', max_length=20, required=True)
    type = Field(CHAR, verbose_name='机构类型', max_length=1, choices=get_var('PARA/KFZX_TYPE'))
    resource_num = Field(int, verbose_name="部门人数")
    
    def __unicode__(self):
        return u'%s' % self.name
    
    class Meta:
        display_field = 'name'
        
    class Table:
        fields = [
                    {'name':'id', 'width':100},
                    {'name':'name', 'width':100},
                    {'name':'type', 'width':100},
                    {'name':'resource_num', 'width':100},
                ]
        
    
class Tx(Model):
    name = Field(CHAR, verbose_name='名称', max_length=20, required=True)

    def __unicode__(self):
        return u'%s' % self.name
    
    class Meta:
        display_field = 'name'
    
    class Table:
        fields = [
                    {'name':'id', 'width':100},
                    {'name':'name', 'width':100},
                ]

class Depart(Model):
    name = Field(CHAR, verbose_name='名称', max_length=20, required=True)
    
    def __unicode__(self):
        return u'%s' % self.name
    
    class Meta:
        display_field = 'name'
    
    class Table:
        fields = [
                    {'name':'id', 'width':100},
                    {'name':'name', 'width':100},
                ]
    